package com.xl.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xl.bean.Login;
import com.xl.bean.Register;
import com.xl.mananger.ModelManager;
import com.xl.service.LoginService;
import com.xl.service.RegisterService;
import com.xl.service.impl.LoginServiceImpl;
import com.xl.service.impl.RegisterServiceImpl;

/**
 * 
 * @author 深圳-夕落  2014-11-25
 * 注册的Action
 */
public class RegisterAction implements Action{

	public String execute(HttpServletRequest request, HttpServletResponse response) 
	{
		Register register = (Register) ModelManager.getModel(request);
		RegisterService service = new RegisterServiceImpl();
		if(service.register(register)){
			request.setAttribute("msg", "注册成功");
			return  "success";
			
		}else
		{
			
			request.setAttribute("msg", "注册失败");
			return  "error";
		}
		
	}

}
